import routes from './routes';

export default {
  define: {
    'process.env.PROJECT_CODE': 'project-management',
    'process.env.PROJECT_VERSION': '1.0.0',

    'process.env.ICON_FONT': {
      scriptUrl: '//at.alicdn.com/t/font_694023_7qe93i9txxc.js',
      extraCommonProps: { theme: 'outlined' },
    },
    'process.env.BASIC_LAYOUT': {
      navTheme: 'dark',
      layout: 'side',
      contentWidth: 'Fluid',
      fixedHeader: false,
      fixSiderbar: true,
    },
  },
  hash: true,
  antd: {
    /**
     * https://umijs.org/zh-CN/plugins/plugin-antd
     */
    compact: false,
  },
  dva: {
    hmr: true,
    disableModelsReExport: false,
    lazyLoad: false,
  },
  history: {
    type: 'browser',
  },
  locale: {
    default: 'zh-CN',
    antd: true,
    baseNavigator: true,
  },
  dynamicImport: {
    loading: '@/components/PageLoading/index',
  },
  targets: {
    ie: 11,
  },
  publicPath: process.env.ENV_PUBLIC_PATH || '/',
  ignoreMomentLocale: true,
  manifest: {
    basePath: '/',
  },
  devtool: 'eval',
  title: false,

  theme: {
    /**
     * 定制主题，重启生效
     * ~antd/lib/style/themes/default.less
     */
    'primary-color': '#247b48',
  },
  routes, // 路由配置
  proxy: {
    '/server/api/': {
      target: 'http://39.104.79.115:8014',
      changeOrigin: true,
      pathRewrite: { '^/server/api/': '/wordformatting/' },
    },
    '/dict/api/': {
      target: 'http://39.104.79.115:8004',
      changeOrigin: true,
      pathRewrite: { '^/dict/api/': '/pvdict/' },
    },
    '/aitrans/api/': {
      target: 'http://192.168.1.8:8080',
      changeOrigin: true,
      pathRewrite: { '^/aitrans/api/': '/' },
    },
    '/wps/api/': {
      target: 'http://www.lvchanglong.com',
      changeOrigin: true,
      pathRewrite: { '^/wps/api/': '/' },
    },
  },
};
